<template>
	<view class="title">
		<view v-if="property.title!=undefined && property.title!=''" class="head-title">
			<view class="icon"></view> 
			<view class="head-cont">
				<view>{{property.title}}</view>
				<view v-if="blockName=='style_head_downarrow'" @click="updateepand">
					<view v-if="property.isExpand" class="iconfont icon-xiangshang"></view>
					<view v-else class="iconfont icon-xiangxia"></view>
				</view>
			</view>
			
		</view>
		<view v-if="title!=undefined && title!=''" class="split"></view>
	</view>
</template>

<script>
	export default {
		props:{
			property:{
				type:Object
			},
			blockName:{
				type:String,
				default(){
					return ''
				}
			},
			listindex:{
				type:Number,
				default(){
					return 0
				}
			},
			listblockindex:{
				type:Number,
				default(){
					return 0
				}
			},
			divArea:{
				type:String,
				default(){
					return ''
				}
			}
		},
		
	
		
		methods:{
			updateepand(){
				var that = this
				var isExpand = that.property.isExpand
				isExpand = !isExpand
				uni.$emit("isExpand", that.divArea, that.listindex, that.listblockindex, isExpand)
			}
		}
	}
</script>

<style>
	.title .head-title{display: flex;flex-direction: row;align-items: center;padding: 5px 10px;}
	.title .head-cont{display: flex;flex-direction: row;align-items: center;justify-content: space-between;width: calc(100vw - 30px);}
	.title .head-title .icon{height: 10px;width: 3px;background-color: #F55C23;display: flex;margin-left: -10px;margin-right: 7px;}
	.title .split{height: 1px;width: 100%;background-color: #f0f0f0;}
</style>
